﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/AdministratorSite.Master" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	ViewDetailsHotel
</asp:Content>
<script runat="server">
    int faciCount = 0;
    int roomCount = 0;
    public void Page_Load()
    {
        faciCount = Int32.Parse(ViewData["numberOfFacilities"].ToString());
        roomCount = Int32.Parse(ViewData["numberOfRoomTypes"].ToString());
        if (faciCount == 0)
        {
            EmptyFaciList.Visible = true;
            DisplayFaciList.Visible = false;
        }
        else{
            EmptyFaciList.Visible = false;
            DisplayFaciList.Visible = true;
        }

        if (roomCount == 0)
        {
            EmptyRoomList.Visible = true;
            DisplayRoomList.Visible = false;
        }
        else
        {
            EmptyRoomList.Visible = false;
            DisplayRoomList.Visible = true;
        }
    }    
</script>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <asp:Panel ID="Panel2" runat="server" Height="61px" 
        style="font-size: xx-large; font-weight: 700; font-family: Calibri">
        <b>Hotel Details - Admin</b></asp:Panel><%: ViewData["ResultMessage"] %>

    <table style="width: 100%">
            <tr>
                <td style="width: 62px">
                    &nbsp;
                </td>
                <td>
                    <% Html.RenderPartial("ViewHotel", ViewData["hotelModel"]); %>
                </td> 
                <td style="width: 62px">
                    &nbsp;
                </td>
            </tr>

            <tr>
                <td style="width: 62px">
                    &nbsp;
                </td>
                <td>
                </td>
                <td style="width: 62px">
                    &nbsp;
                </td>
             </tr>
             
            <tr>
                <td style="width: 62px">
                    &nbsp;
                </td>
                <td>
                     <asp:panel id="EmptyRoomList" runat="server" visible="false">
                             <fieldset>
                                <legend>Room General Info</legend>
                                <%: Html.ActionLink("Add new room type", "AddRoomType", "AdminCreate/CreateRoom", ViewData["hotelModel"], new { })%> |
                                <div class="display-label">Currently no room info</div>
                               </fieldset>
                    </asp:panel>
                    <asp:panel id="DisplayRoomList" runat="server" visible="false">
                             <fieldset>
                                <legend>Room General Info</legend>
                                <%: Html.ActionLink("Add new room type", "AddRoomType", "AdminCreate/CreateRoom", ViewData["hotelModel"], new { })%> |
                               <% for(int count = 0; count < roomCount; count ++)
                                 { %>
                                    <% Html.RenderPartial("ViewRooms", ViewData["roomListModel" + count]); %>
                              <% } %>
                          
                               </fieldset>
                    </asp:panel>
                   </td> 
                <td style="width: 62px">
                    &nbsp;
                </td>
               </tr>
            <tr>
            <td style="width: 62px">
                    &nbsp;
                </td>
                <td>
                    &nbsp;
                </td>
                <td style="width: 62px">
                    &nbsp;
                </td></tr>
            <tr>
                <td style="width: 62px">
                    &nbsp;
                </td>
                <td>
                   </td>
                <td style="width: 62px">
                    &nbsp;
                </td>
             </tr>
            <tr>
                <td style="width: 62px">
                    &nbsp;
                </td>
                <td>
                    <asp:panel id="EmptyFaciList" runat="server" visible="false">
                     <fieldset>
                        <legend>Facility General Info</legend>
                         <%: Html.ActionLink("Add new facility", "AddFacility", "AdminCreate/CreateFacility", ViewData["hotelModel"], new { })%> |
                        <div class="display-label">Currently no facility info</div>
                      </fieldset>
                      </asp:panel>
                    <asp:panel id="DisplayFaciList" runat="server" visible="false">
                        <fieldset>
                        <legend>Facility General Info</legend>
                        <%: Html.ActionLink("Add new facility", "AddFacility", "AdminCreate/CreateFacility", ViewData["hotelModel"], new { })%> |
                            <% for(int count = 0; count < faciCount; count ++)
                             { %>
                                <% Html.RenderPartial("ViewFacilities", ViewData["faciListModel" + count]); %>
                          <% } %>
                        </fieldset>
                    </asp:panel>
                  </td>
                <td style="width: 62px">
                    &nbsp;
                </td>
            </tr>
           
    </table>
    
        <%: Html.ActionLink("Back to Main Page", "Index", "AdminMain")%> |
</asp:Content>
